package com.ChenYaRou.www.dao;

import com.ChenYaRou.www.po.Role;

import java.sql.SQLException;

/**
 * @author 86183
 */
public interface RoleDao {
    /**
     * 查找role
     * @param role 仅赋值条件的role
     * @return 街区集合
     * @throws IllegalAccessException
     * @throws SQLException
     * @throws NoSuchFieldException
     * @throws InstantiationException
     */
    Role select(Role role) throws IllegalAccessException,
            SQLException, NoSuchFieldException, InstantiationException;

    /**
     * update role
     * @param newRole role需要更新的值
     * @param  oldRole old role
     * @return 成功与否
     * @throws IllegalAccessException
     * @throws SQLException
     */
    int update(Role newRole,Role oldRole) throws IllegalAccessException, SQLException;
    /**
     * 插入role
     * @param role 新role
     * @return 更新条数
     * @throws IllegalAccessException
     * @throws SQLException
     */
    int insert(Role role) throws IllegalAccessException, SQLException;
}
